<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">
    <link href="/admin/static/welcome/frontend.min.css" rel="stylesheet">
    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="/admin/static/myfolder/js/common.js?ver={{config('constant.static_res_ver')}}"></script>
    <script type="text/javascript" src="/admin/lib/layer/3.1.1/layer.js"></script>
</head>

<body>
<main class="content">
    <section class="section suitable-section text-center pix-padding-bottom-40" id="suitable">
        <div class="container">
            <div class="row">
                
                    @if($expirecount !== null)
                        <div class="col-sm-4 suitable-item">
                            <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-30">
                                <div class="pix-margin-bottom-20 suitable-img img-zoom">
                                    @if($expirecount > 0)
                                        <img src="/admin/static/welcome/warn-red.png" alt="">
                                    @else
                                        <img src="/admin/static/welcome/warn-blue.png" alt="">
                                    @endif
                                </div>
                                <div class="suitable-title">
                                    <strong @if($expirecount > 0) style="color: red;" @endif>到期预警({{$expirecount}})</strong>
                                </div>
                                <p class="suitable-intro">
                                    提前{{$settingdata['days']}}天通知，到期15天后不再提醒
                                </p>
                                <p>
                                    <a href="/{{config('constant.name_admin')}}/contract/expire"
                                       class="btn blue-bg pix-white btn-round-lg wide">
                                        <b>进 入</b>
                                    </a>
                                </p>
                            </div>
                        </div>
                    @endif
                    <div class="col-sm-4 suitable-item">
                        <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-30">
                            <div class="pix-margin-bottom-20 suitable-img img-zoom">
                                <img src="/admin/static/welcome/code.png" alt="">
                            </div>
                            <div class="suitable-title">
                                <strong>新建批次</strong>
                            </div>
                            <p class="suitable-intro">
                                创建一个空的批次
                            </p>
                            <p>
                                <a href="/{{config('constant.name_admin')}}/contract/addShow"
                                   class="btn blue-bg pix-white btn-round-lg wide">
                                    <b>进 入</b>
                                </a>
                            </p>
                        </div>
                    </div>
                    <div class="col-sm-4 suitable-item">
                        <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                            <div class="pix-margin-bottom-20 suitable-img img-zoom">
                                <img src="/admin/static/welcome/mobile.png" alt="">
                            </div>
                            <div class="suitable-title">
                                <strong>扫码受理和拍照</strong>
                            </div>
                            <p class="suitable-intro">
                                扫码受理和不合格/斗臂车拍照
                            </p>
                            <p>
                                @php $url = "/".config('constant.name_admin')."/app/index";  @endphp
                                <a onclick="layer_show('扫码受理和拍照','{{$url}}','','',1)"
                                   class="btn blue-bg pix-white btn-round-lg wide" target="_blank">
                                    <b>进 入</b>
                                </a>
                            </p>
                        </div>
                    </div>
                    <div class="col-sm-4 suitable-item">
                        <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                            <div class="pix-margin-bottom-20 suitable-img img-zoom">
                                <img src="/admin/static/welcome/browser.png" alt="">
                            </div>
                            <div class="suitable-title">
                                <strong>结果录入</strong>
                            </div>
                            <p class="suitable-intro">
                                试验人员在这里录入检测结果
                            </p>
                            <p>
                                <a href="/{{config('constant.name_admin')}}/contract/indexResLuru"
                                   class="btn blue-bg pix-white btn-round-lg wide">
                                    <b>进 入</b>
                                </a>
                            </p>
                        </div>
                    </div>
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/laptop.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>个人信息</strong>
                        </div>
                        <p class="suitable-intro">
                            编辑查看个人信息
                        </p>
                        <p>
                            <a href="/{{config('constant.name_admin')}}/manager/editself"
                               class="btn blue-bg pix-white btn-round-lg wide">
                                <b>进 入</b>
                            </a>
                        </p>
                    </div>
                </div>
                @if(config('constant.bt_api_key'))
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/backup.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>数据备份</strong>
                        </div>
                        <p class="suitable-intro">
                            数据库备份到服务器
                        </p>
                        <p>
                            <a class="btn blue-bg pix-white btn-round-lg wide" id="back_up">
                                <b>备 份</b>
                            </a>
                        </p>
                    </div>
                </div>
                @endif
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20">
                        <div class="pix-margin-bottom-20 suitable-img img-zoom">
                            <img src="/admin/static/welcome/zks.png" alt="">
                        </div>
                        <div class="suitable-title">
                            <strong>中控室</strong>
                        </div>
                        <p class="suitable-intro">
                            LED智慧实验室
                        </p>
                        <p>
                            <a href="/{{config('constant.name_admin')}}/zks/index" class="btn blue-bg pix-white btn-round-lg wide" target="_blank">
                                <b>进 入</b>
                            </a>
                        </p>
                    </div>
                </div>
                @if(!config('constant.is_lan'))
                <div class="col-sm-4 suitable-item">
                    <div class="pix-content text-center pix-padding-v-50 pix-margin-v-10 pix-padding-h-20" style="overflow: hidden;">
                        <div id="weather">
                        </div>
                        <div class="suitable-title">
                            <strong><span id="weather-area"></span> <span id="weather-text"></span></strong>
                        </div>
                        <p class="suitable-intro" id="weather-time">
                        </p>
                        <p>
                            <div id="weather-refresh" class="btn blue-bg pix-white btn-round-lg wide" target="_blank">
                                <b>刷新天气</b>
                            </div>
                        </p>
                    </div>
                </div>
                @endif
            </div>
        </div>
    </section>
</main>
<script type="text/javascript" src="/admin/lib/jquery/jquery.cookie.min.js"></script>
<script type="text/javascript" src="/admin/lib/layer/3.1.1/layer.js"></script>
<script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
<script>
    var alert_pwd_msg = '{{$alert_pwd_msg}}',
        is_lan = "{{config('constant.is_lan')}}";
    $(function () {
        alert_pwd_msg != '' ? layer.confirm(alert_pwd_msg,{btn:['更新密码']},function () {
            layer_show('更新密码','/{{config('constant.name_admin')}}/manager/editpassself');
        }) : '';
        if ($('.container > .row > .suitable-item').length > 6) {
            $('.container > .row > .suitable-item').removeClass('col-sm-4').addClass('col-sm-3')
        }
        if(is_lan != 1){ //不是局域网
            // $('#weather-refresh').trigger('click');
        }
    })

    var addr = @json($addr);
    $(function () {
        if ($('.container > .row > .suitable-item').length > 6) {
            $('.container > .row > .suitable-item').removeClass('col-sm-4').addClass('col-sm-3')
        }
        if(!{{config('constant.is_lan')}}){
            addr = JSON.parse($addr);
            if (addr.status !== 0) {
                layer.msg('地址获取失败');
                return false;
            }
            if('{{config('constant.app_name')}}' === 'HuiBangJianCe' || '{{isAdmin()}}' ){
                $('#weather-area').text(addr.content.address);
                ajax('get', 'https://devapi.qweather.com/v7/weather/now?key=b53bf235be9a425697374c3b4bbc2f67&location=' + addr.content.point.x + ',' + addr.content.point.y, '', getWeather, 0);
            }
        }
    })

    $('#weather-refresh').on('click',function () {
        ajax('get', 'https://devapi.qweather.com/v7/weather/now?key=b53bf235be9a425697374c3b4bbc2f67&location=' + addr.content.point.x + ',' + addr.content.point.y, '', getWeather, 0);
    })

    function getWeather(res) {
        if (res.code !== '200') {
            layer.msg('获取天气失败！');
            return false;
        }
        let now = res.now;
        let str = '<div>温度：' + now.temp + '℃ <br>' +
            '风向角度：' + now.wind360 + '<br>' +
            '风向：' + now.windDir + '<br>' +
            '风力等级：' + now.windScale + '<br>' +
            // '风速：' + now.windSpeed + '公里/小时 <br>'+
            '相对湿度：' + now.humidity + '% <br>' +
            '大气压强：' + now.pressure / 10 + 'kPa <br>' +
            '能见度：' + now.vis + 'km </div>';
        $('#weather').html(str);
        $('#weather-text').html('&nbsp;&nbsp;&nbsp;&nbsp;' + now.text);
        $('#weather-time').text('观测时间：' + now.obsTime.substr(0, 10) + ' ' + now.obsTime.substr(11, 5));
    }
    $('#back_up').on('click',function (event) {
        ajax('get', "{{'/'.config('constant.name_admin').'/setting/backUp'}}", '', backUpBak, 0);
        function backUpBak(res) {
            layer.msg(res);
        }
    })
</script>
</body>
</html>
